﻿@model MobileSales.Model.Employees.Employee

@{
    View.Title = Strings.Employees + " - " + Strings.Edit;
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>@Strings.Employees &nbsp;&raquo;&nbsp; @Strings.Edit</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>@Strings.Fields</legend>

        @Html.HiddenFor(model => model.Id)

        <div class="editor-label">
            @Html.LabelFor(model => model.Email)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Email)
            @Html.ValidationMessageFor(model => model.Email)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.SupervisorId)
        </div>
        <div class="editor-field">
            @Html.EmployeeSelect("SupervisorId", Model.SupervisorId)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Firstname)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Firstname)
            @Html.ValidationMessageFor(model => model.Firstname)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Lastname)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Lastname)
            @Html.ValidationMessageFor(model => model.Lastname)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Password)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Password)
            @Html.ValidationMessageFor(model => model.Password)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Zipcode)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Zipcode)
            @Html.ValidationMessageFor(model => model.Zipcode)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.City)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.City)
            @Html.ValidationMessageFor(model => model.City)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Street)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Street)
            @Html.ValidationMessageFor(model => model.Street)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Phone)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Phone)
            @Html.ValidationMessageFor(model => model.Phone)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.LocationLongitude)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.LocationLongitude)
            @Html.ValidationMessageFor(model => model.LocationLongitude)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.LocationLatitude)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.LocationLatitude)
            @Html.ValidationMessageFor(model => model.LocationLatitude)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.LocationTimestamp)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.LocationTimestamp)
            @Html.ValidationMessageFor(model => model.LocationTimestamp)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Login)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Login)
            @Html.ValidationMessageFor(model => model.Login)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Language)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Language)
            @Html.ValidationMessageFor(model => model.Language)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.IsApproved)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.IsApproved)
            @Html.ValidationMessageFor(model => model.IsApproved)
        </div>
        
        
        <div class="editor-label">
            @Html.LabelFor(model => model.Contract)
        </div>
        <div class="editor-field">
            @Html.ContractSelect("contractId", Model.Contract.Id)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Role)
        </div>
        <div class="editor-field">
            @Html.RoleSelect("roleId", Model.Role.Id)
        </div>

        @Html.ParamsEditorsFor(MobileSales.Model.Params.ParamType.Employee, Model.Params)
        <p>
            <input type="submit" value="@Strings.Save" />
        </p>
    </fieldset>
}

<div>
   @Html.ActionLink(Strings.BackToList, "Index", null, new { @class="icon-button prev-icon" })
</div>

